You are here: FAQ > Documaker Standard Edition FAQ > Archive Issues > How do I change the archive keys?

How do I change the archive keys?

When the new key information exists in the archive index, back up your current archive index (should include *.DBF, *.MDX and DFD files) and follow these steps:

Change the APPIDX.DFD file to create a key based on new field. Here is an example key section from APPIDX.DFD:

< Keys >
KeyName = Key1
KeyName = Key2
KeyName = KeyID
< Key:Key1 >
Expression = Key1
FieldList = Key1
< Key:Key2 >
Expression = Key2
FieldList = Key2
< Key:KeyID >
Expression = KeyID

To replace Key2 key with CUSTNAME key, you will need to do this:

< Keys >
KeyName = Key1
KeyName = CUSTNAME
KeyName = KeyID
< Key:Key1 >
Expression = Key1
FieldList = Key1
< Key:CUSTNAME >
Expression = CUSTNAME
FieldList = CUSTNAME
< Key:KeyID >
Expression = KeyID
FieldList = KeyID

Remove the APPIDX.MDX file.

Run the reindex command as shown here:

REINDEXW /I=APPIDX /D=APPIDX.DFD

This creates a new APPIDX.MDX file.

Change the ArcRet control group to specify CUSTNAME as Key2.

If one of these steps fails, restore the original index before you try again.

Note   You cannot simply add a new field to the DFD for an existing archive unless you have a database that supports dynamic columns. Even in that situation, however, the new field for all the existing records will be blank.

When the new key information does not exists in the archive index, follow these steps:

Back up your current archive index (include *.DBF, *.MDX and DFD files).

Use your third party database software to create the new key field in the APPIDX.DBF file. Again, the new key information will not be populated for existing archive records. This new key field will be blank.

Remove the APPIDX.MDX file.

Run the reindex command as shown here:

REINDEXW /I=APPIDX /D=APPIDX.DFD

This should create a new APPIDX.MDX file.

Change the ArcRet control group to specify CUSTNAME as Key2.

If one of these steps fails, restore the original index before you try again.

Keep in mind that this is not something to be done unless you have first created and verified that you have a full backup — perhaps even to permanent media (like a CD).

Also note that although it is possible to add a new field in the manner described, changing the index also means that you have to start a new CAR file. If you are running the GenArc program, this is probably not an issue since, typically, most users are set up to create a new CAR file each time they run GenArc.

You should, however, make sure this is how your system is set up. If you are also using Documaker Desktop to create archives, you will need to handle this manually.

Also note that you will no longer be able to rebuild your archive index from the old (original) CAR files. Instead, you would first have to restore the original DFD and then use the utility to rebuild the index from the CAR files. You then would have to do the steps again to re-add the field in question. Then you would have to rebuild the index from any newer CAR files that were created after that original change.